/**
 * 用来检则XMLHttpRequest对象兼容性的函数
 * 在创建XMLHttpRequest对象时可以直接使用：var request = getHTTPObject();
 * Created by Ford Zhang on 2016/12/30.
 */

function getHTTPObject() {
	if(typeof XMLHttpRequest == 'undefined') {
		XMLHttpRequest = function () {
			try {
				return new ActiveXObject('Msxml2.XMLHTTP.6.0');
			} catch (e) {}
			try {
				return new ActiveXObject('Msxml2.XMLHTTP.3.0');
			} catch (e) {}
			try {
				return new ActiveXObject('Msxml2.XMLHTTP');

			} catch (e) {}
		}
	}

	return new XMLHttpRequest();

}